package com.flash.ReportManagement.mapper;

import com.flash.ReportManagement.entity.CashPositionStatement;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.javassist.bytecode.LineNumberAttribute;

import java.util.List;
import java.util.Map;

@Mapper
public interface CashPositionStatementMapper {

    @Select("select accountName,money from \n" +
            "(select * from cashStock) cs\n" +
            "join\n" +
            "(select * from cash)c\n" +
            "on cs.cashId=c.cashId\n" +
            "union all\n" +
            "select '申购赎回',nvl(sum(money*businessState),0) from cashAccrualStock\n" +
            "where businessType=4 and dateAccrualStock=#{dateAccrualStock}\n" +
            "union all\n" +
            "select '清算款',nvl(sum(money*businessState),0) from securityAccrualStock \n" +
            "where securityType=2 and dateAccrualStock=#{dateAccrualStock}")
    public List<CashPositionStatement> selectCashPositionStatement(Map map);
}
